<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="dropdown-toggle" data-toggle="dropdown">
    <div class="input-group">
        <input class="form-control" type="text"
               value="<%=contact.getTelephones() != null?contact.getTelephones()[0].getPhone_number():"Empty"%>"
               readonly>
        <span class="glyphicon glyphicon-list input-group-addon addon"></span>
    </div>
</div>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
    <%
        if (null != contact.getTelephones()) {
            for (int item = 1; item < contact.getTelephones().length; item++) {%>
    <li role="presentation">
        <div role="menuitem" class="input-group" tabindex="-1">
            <input type="text" class="form-control" name="phone"
                   value="<%=contact.getTelephones()[item].getPhone_number()%>" readonly>
            <span class="glyphicon glyphicon-list input-group-addon addon"></span>
        </div>
    </li>
    <%
            }
        }
    %>
    <li role="presentation">
        <form action="route.jsp?opt=newPhone&id=<%=contact.getContact_id()%>%>"
              method="post">
            <div class="input-group">
                <input type="text" class="form-control" placeholder="新增号码">
                <button class="glyphicon glyphicon-plus addon input-group-addon"></button>
            </div>
        </form>
    </li>
</ul>